package com.sell.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Pager implements Serializable{
	private int pageNo;//当前页
	private int totalCount;//总条数
	private int pageSize;//每页显示条数
	private int totalPage;//总页数

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public Pager(int rowCount, int pageSize, int pageNo) {
		this.totalCount = rowCount;
		this.pageSize = pageSize;
		this.pageNo = pageNo;
		if(this.totalCount % this.pageSize == 0){
			this.totalPage = this.totalCount / this.pageSize;
		}else if(this.totalCount % this.pageSize > 0){
			this.totalPage = this.totalCount / this.pageSize + 1;
		}else{
			this.totalPage = 0;
		}
	}
}
